package com.ewins.weatherdataclient.ui;

/**
 * Created by anzilu on 2016/1/11.
 */

import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.GridPane;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

public class OptionDialogDownload {

    Button btnOk;
    Button btnCancel;
    final  Stage stage = new Stage();
    public OptionDialogDownload(Stage stg) {

        btnOk = new Button();
        btnCancel=new Button();
        Label placeHolder1=new Label("     ");
        Label placeHolder2=new Label("重新下载该文件吗？");
        placeHolder2.setFont(new Font("Arial", 20));
        Label placeHolder3=new Label("     ");
        Label placeHolder4=new Label("     ");

        //Initialize the Stage with type of modal
        stage.initModality(Modality.APPLICATION_MODAL);
        //Set the owner of the Stage
        stage.initOwner(stg);
        stage.initStyle(StageStyle.UTILITY);
        stage.setTitle("");
        //Group root = new Group();
        GridPane root=new GridPane();
        btnOk.setLayoutX(100);
        btnOk.setLayoutY(80);
        btnOk.setText("OK");
        btnCancel.setLayoutX(100);
        btnCancel.setLayoutY(80);
        btnCancel.setText("Cancel");
        root.add(placeHolder1,1,1);
        root.add(placeHolder2,2,2);
        root.add(placeHolder3,2,3);
        root.add(btnCancel,2,4);
        root.add(placeHolder4, 3, 4);
        root.add(btnOk,4,4);
        Scene scene = new Scene(root, 300, 100, Color.WHITE);
        scene.setRoot(root);
        stage.setScene(scene);
        stage.show();

    }

    public void close(){
        if(stage!=null){
            stage.close();
        }

    }

}
